package io.github.junxworks.junx.stream.extractor.file;

import io.github.junxworks.junx.stream.extractor.AbstractExtractor;
import io.github.junxworks.junx.stream.extractor.ExtractContext;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * 文件数据抽取
 *
 * @author Michael
 * @date 2024/11/19
 */
@Slf4j
@Setter
@Getter
public abstract class FileExctractor extends AbstractExtractor {
    protected String filePath;

    /**
     * @param context
     * @throws Exception
     */
    @Override
    public void extract(ExtractContext context) throws Exception {
        super.beforeExtract(context);
        filePath = context.getFilePath();
        extractFile(context);
    }

    public abstract void extractFile(ExtractContext context) throws Exception;

}
